package com.courage.shardingsphere.jdbc.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.courage.shardingsphere.jdbc.domain.mapper.UserMapper;
import com.courage.shardingsphere.jdbc.domain.po.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author xingg
 * @create 2023/3/22 15:48
 */
@Service
public class UserService {
    @Autowired
    private UserMapper userMapper;

    public List<User> queryUserList() {
        LambdaQueryWrapper<User> userLambdaQueryWrapper = Wrappers.<User>lambdaQuery();
        return userMapper.selectList(userLambdaQueryWrapper);
    }

    public int save(User user) {
      return   userMapper.insert(user);
    }
}
